﻿	CREATE TABLE public.resource_credential
	(
	    /***************************************************************************************************
	    **  Table:	    public.resource_credential
	    **  Author:		Zhixian Ong
	    **
	    **  Description:
	    **    
	    **    List of registered resource credentials.
	    **
	    **  Fields (3):
	    **
	    **      id          - Defaults to nextval('resource_credential_id_seq')
	    **      account_id  - 
	    **      resource_id - 
	    **      username    - 
	    **      password    - 
	    **
	    **  Constaints (2):
	    **
	    **      resource_credential_pk - 
	    **      resource_credential_uc - 
	    **
	    **  Modification History:
	    **
	    **      20140102  Zhixian Ong     - Initial prototype
	    ** 
	    **  Status:
	    **
	    **      Dev
	    ** 
	    ***************************************************************************************************/
        
	    -- [Fields]
	    id          integer                 NOT NULL DEFAULT nextval('resource_type_id_seq'), 
	    account_id  character varying(128)  NOT NULL,
	    resource_id integer                 NOT NULL,
	    username    character varying(128)  NULL,
	    password    character varying(128)  NULL,
        
	    -- [Constraints]
	    CONSTRAINT resource_credential_pk PRIMARY KEY (id),
	    CONSTRAINT resource_credential_uc UNIQUE (account_id, resource_id, username)
	);